package com.tang.model.vistor;

import java.util.LinkedList;
import java.util.List;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/8 7:57
 * @Desc
 * @Remarks
 */
public class BusinessReport {

    private List<IEmployee> employees = new LinkedList<IEmployee>();

    public BusinessReport() {
        employees.add(new Manager("产品经理A"));
        employees.add(new Engineer("程序员A"));
        employees.add(new Engineer("程序员B"));
        employees.add(new Engineer("程序员C"));
        employees.add(new Manager("产品经理B"));
        employees.add(new Engineer("程序员D"));
    }

    public void showReport(IVisitor visitor) {
        if (null == employees || employees.size() < 1) {
            return;
        }
        for (IEmployee employee : employees) {
            employee.accept(visitor);
        }
    }
}
